Recover legacy attached portal state - #29
Merged
Merged
Conversation
kiroro123
marked this pull request as ready for review
July 8, 2026 08:29
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PortalManager.attach_owned_process(...)for the legacy_fake_server_proccompatibility path.PortalManagerinternals.Popen.argsreads during manifest saves.Why
PR #28 made process identity immutable after child launch, but the legacy
_fake_server_procshim could still import a live portal process into a freshPortalManagerwithout_process_identity. Iffake_server_ready()succeeded,launch_fake_server()was skipped and no managed portal record was written. This closes that narrow compatibility gap.Tests
PortalManager.attach_owned_process(...)captures identity and argv once._fake_server_procimport now produces recoverable portal persistence even when readiness is already true.Validation
.venv/bin/python -m pytest tests/test_portal_manager.py tests/test_orchestrator.py tests/test_managers.py -q-> 89 passed, 2 subtests passed.venv/bin/python -m coverage run -m pytest -q-> 380 passed, 5 skipped, 16 subtests passed.venv/bin/python -m coverage report --fail-under=60-> total 69.48%.venv/bin/python -m coverage report --include='src/netshaper/core/session_plan.py' --fail-under=95-> 98.63%.venv/bin/python -m coverage report --include='src/netshaper/core/session_runner.py' --fail-under=95-> 97.37%.venv/bin/python -m coverage report --include='src/netshaper/core/portal_manager.py' --fail-under=85-> 88.56%.venv/bin/python -m coverage report --include='src/netshaper/core/elevated.py,src/netshaper/core/session_plan.py,src/netshaper/core/session_runner.py' --fail-under=80-> 97.86%.venv/bin/python -m ruff check ..venv/bin/python -m mypy.venv/bin/python -m bandit -c pyproject.toml -r src/netshaper